.TH std::tx_exception 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::tx_exception \- std::tx_exception

.SH Synopsis
   Defined in header <stdexcept>
   template< class T >                              (TM TS)
   class tx_exception : public std::runtime_error;

   Defines an exception type that can be used to cancel and roll back an atomic
   transaction initiated by the keyword atomic_cancel.

   If T is not TriviallyCopyable, the program that specializes std::tx_exception<T> is
   ill-formed.

.SH Member functions

std::tx_exception::tx_exception

   explicit tx_exception( T value ) transaction_safe;                     \fB(1)\fP (TM TS)
   tx_exception( T value, const std::string& what_arg ) transaction_safe; \fB(2)\fP (TM TS)
   tx_exception( T value, const char* what_arg ) transaction_safe;        \fB(3)\fP (TM TS)
   tx_exception( const tx_exception& other ) transaction_safe noexcept;   \fB(4)\fP (TM TS)

   1-3) Constructs the exception object with what_arg as explanatory string that can be
   accessed through what() and value as the object that can be accessed through get().
   4) Copy constructor. If *this and other both have dynamic type std::tx_exception<T>
   then std::strcmp(what(), other.what()) == 0.

.SH Parameters

   value    - payload object
   what_arg - explanatory string
   other    - another exception object to copy

.SH Exceptions

   1-3) May throw implementation-defined exceptions.

std::tx_exception::operator=

   tx_exception& operator=( const tx_exception& other ) transaction_safe        (TM TS)
   noexcept;

   Assigns the contents with those of other. If *this and other both have dynamic type
   std::tx_exception<T> then std::strcmp(what(), other.what()) == 0 after assignment.

.SH Parameters

   other - another exception object to assign with

.SH Return value

   *this

std::tx_exception::get

   T get() const transaction_safe;  (TM TS)

   Returns the payload object held by the exception object.

.SH Exceptions

   May throw implementation-defined exceptions.

std::tx_exception::what

   virtual const char* what() const transaction_safe_dynamic noexcept;  (TM TS)

   Returns the explanatory string.

.SH Parameters

   \fI(none)\fP

.SH Return value

   Pointer to a null-terminated string with explanatory information.

Inherited from std::runtime_error

Inherited from std::exception

.SH Member functions

   destructor   destroys the exception object
   \fB[virtual]\fP    \fI(virtual public member function of std::exception)\fP
   what         returns an explanatory string
   \fB[virtual]\fP    \fI(virtual public member function of std::exception)\fP
